package com.xs.boot.service.impl;

import com.xs.boot.dao.kaosheng.PersonalRegistMapper;
import com.xs.boot.entity.kaosheng.DistrictEntity;
import com.xs.boot.entity.kaosheng.MajorEntity;
import com.xs.boot.entity.kaosheng.StudentInfoEntity;
import com.xs.boot.entity.kaosheng.ZhuKaoSchoolEntity;
import com.xs.boot.service.IKaoShengService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class KaoShengService implements IKaoShengService{
    @Resource
    private PersonalRegistMapper personalRegistMapper;

    @Override
    @Transactional
    public int insert(StudentInfoEntity studentInfoEntity) {
        return personalRegistMapper.insert(studentInfoEntity);
    }

    @Override
    public List<MajorEntity> getAllMajors() {
        return personalRegistMapper.getAllMajors();
    }

    @Override
    public List<DistrictEntity> getAllCities() {
        return personalRegistMapper.getAllCities();
    }

    @Override
    public List<DistrictEntity> getAllDistricts(String cityCode) {
        return personalRegistMapper.getAllDistricts(cityCode);
    }

    @Override
    public List<ZhuKaoSchoolEntity> getAllZhuKaoSchools() {
        return personalRegistMapper.getAllZhuKaoSchools();
    }

    @Override
    @Transactional
    public int updateStudentInfo(StudentInfoEntity studentInfoEntity){
        return personalRegistMapper.updateStudentInfo(studentInfoEntity);
    }
}
